<div id="view" class="scroll" xmlns:v-on="http://www.w3.org/1999/xhtml">

    <div class="section" style>
        <!--focused 属性目前似乎有个bug,箭头图标不对-->
        <ui-section style="display: none;">
            <div class="header greenColor">Http服务</div>
            <ui-prop name="访问网址">
                <div class="flex-1" @mousedown="onBtnClickTestHttp">
                    <ui-input disabled style="width: 100%;" v-value="testHttpUrl"></ui-input>
                </div>
                <ui-button @click="onBtnClickOpenTestHttpServer">
                    开启Http服务
                </ui-button>
            </ui-prop>
        </ui-section>

        <!-- -----------------------------正式服配置----------------------------- -->
        <ui-section>
            <div class="header greenColor" style="color: #33b2e4;">正式服Manifest配置</div>
            <div class="layout vertical start-justified">
                <ui-prop name="新版本号">
                    <div class="flex-1 layout horizontal center">
                        <ui-input class="flex-1" v-on:blur="onInputVersionOver('release')" v-value="version"></ui-input>
                    </div>
                </ui-prop>

                <ui-prop name="正式服URL" tooltip="游戏热更新服务器的url">
                    <div class="flex-1 layout horizontal center">
                        <ui-input class="flex-2" placeholder="正式服热更新URL" v-on:blur="onInPutUrlOver('release')" v-value="serverRootDir"></ui-input>
                        <!--<ui-button v-on:confirm="onTestUrl">Test URL</ui-button>-->
                        <!--<ui-button v-on:confirm="onOpenUrl">浏览器访问</ui-button>-->
                        <ui-input style="width: 45px;" readonly v-value="remoteServerVersion" v-if="isShowRemoteServerVersion"></ui-input>
                        <ui-button v-on:confirm="userLocalIP('release')">使用本机IP</ui-button>
                    </div>
                </ui-prop>

                <!-- 配置历史 -->
                <ui-prop name="URL配置历史">
                    <div class="flex-1 layout horizontal center">
                        <ui-select class="flex-2" style="width: auto" id="hotAddressSelect" v-on:change="onChangeSelectHotAddress">
                            <option v-for="(index, address) in hotAddressArray" v-bind:value="address">
                                {{'['+index+'] ' +address}}
                            </option>
                        </ui-select>
                        <ui-button class="green" v-on:confirm="onBtnClickUseSelectedHotAddress" v-show="isShowUseAddrBtn">使用
                        </ui-button>
                        <ui-button class="red" v-on:confirm="onBtnClickDelSelectedHotAddress" v-show="isShowDelAddrBtn">
                            删除
                        </ui-button>
                    </div>
                </ui-prop>

                <ui-prop name="build项目资源文件目录">
                    <div class="flex-1 layout horizontal center">
                        <ui-input class="flex-2" readonly disabled v-value="resourceRootDir"></ui-input>
                        <ui-button v-on:confirm="onSelectResourceRootDir">选择</ui-button>
                        <ui-button v-on:confirm="onOpenResourceDir">
                            <i class="icon-doc-text"></i>
                            <!--打开-->
                        </ui-button>
                    </div>
                </ui-prop>

                <ui-prop name="manifest存储目录">
                    <div class="flex-1 layout horizontal center">
                        <ui-input class="flex-2" readonly disabled v-value="genManifestDir"></ui-input>
                        <!-- <ui-button v-on:confirm="onSelectGenManifestDir">选择</ui-button> -->
                        <ui-button v-on:confirm="onOpenManifestDir('release')">
                            <i class="icon-doc-text"></i>
                            <!--打开-->
                        </ui-button>
                    </div>
                </ui-prop>

                <div class="self-end">
                    <ui-button class="self-end green" v-on:confirm="onClickGenCfg">生成正式服资源</ui-button>
                    <ui-button class="self-end blue" v-on:confirm="onClickOpenVersionDir">
                        <i class="fa fa-folder-open">打开目录</i>
                    </ui-button>

                </div>
            </div>

        </ui-section>

        <!-- -----------------------------测试服配置----------------------------- -->
        <ui-section>
            <div class="header greenColor" style="color: #33b2e4;">测试服Manifest配置</div>
            <div class="layout vertical start-justified">
                <ui-prop name="新版本号">
                    <div class="flex-1 layout horizontal center">
                        <ui-input class="flex-1" v-on:blur="onInputVersionOver('debug')" v-value="versionDebug"></ui-input>
                    </div>
                </ui-prop>

                <ui-prop name="测试服URL" tooltip="游戏热更新服务器的url">
                    <div class="flex-1 layout horizontal center">
                        <ui-input class="flex-2" placeholder="测试服热更新URL" v-on:blur="onInPutUrlOver('debug')" v-value="serverRootDirDebug"></ui-input>
                        <ui-input style="width: 45px;" readonly v-value="remoteServerVersionDebug" v-if="isShowRemoteServerVersionDebug"></ui-input>
                        <ui-button v-on:confirm="userLocalIP('debug')">使用本机IP</ui-button>
                    </div>
                </ui-prop>

                <!-- <ui-prop name="build项目资源文件目录">
                    <div class="flex-1 layout horizontal center">
                        <ui-input class="flex-2" readonly disabled v-value="resourceRootDir"></ui-input>
                        <ui-button v-on:confirm="onSelectResourceRootDir">选择</ui-button>
                        <ui-button v-on:confirm="onOpenResourceDir">
                            <i class="icon-doc-text"></i>
                        </ui-button>
                    </div>
                </ui-prop> -->

                <ui-prop name="manifest存储目录">
                    <div class="flex-1 layout horizontal center">
                        <ui-input class="flex-2" readonly disabled v-value="genManifestDirDebug"></ui-input>
                        <!-- <ui-button v-on:confirm="onSelectGenManifestDir">选择</ui-button> -->
                        <ui-button v-on:confirm="onOpenManifestDir('debug')">
                            <i class="icon-doc-text"></i>
                        </ui-button>
                    </div>
                </ui-prop>

                <div class="self-end">
                    <ui-button class="self-end green" v-on:confirm="onClickGenCfgDebug">生成测试服资源</ui-button>
                    <ui-button class="self-end blue" v-on:confirm="onClickOpenVersionDir">
                        <i class="fa fa-folder-open">打开目录</i>
                    </ui-button>
                </div>
            </div>
        </ui-section>

        <!-- ====================当前游戏配置====================== -->
        <ui-section>
            <div class="header greenColor" style="color: #2fc9c1;">当前游戏配置:正式服</div>
            <ui-prop name="热更配置(检测提示)" v-show="localGameProjectManifest.length===0||localGameProjectManifest===null">
                <div class="flex-1 layout horizontal center">
                    <span class="flex-2" style="color: #ff1500;">
                        未发现正式服manifest热更新配置文件,请生成一份后导入到项目
                    </span>
                    <!--<ui-input class="flex-2" placeholder="未发现manifest热更新配置文件,请生成一份后导入到项目">-->

                    <!--</ui-input>-->
                    <ui-button title="将生成的2个manifest文件导入到项目中" class="end-justified red" v-on:confirm="onSelectProjectManifestDir('release')">
                        导入
                    </ui-button>
                </div>
            </ui-prop>

            <div class="layout vertical" v-show="localGameProjectManifest.length>0">
                <ui-prop name="热更配置(project.mainfest)">
                    <div class="flex-1 layout horizontal center">
                        <ui-input class="flex-1" disabled v-value="localGameProjectManifest"></ui-input>
                        <ui-button v-on:confirm="onOpenLocalGameManifestDir('release')">
                            <i class="icon-doc-text"></i>
                            <!--打开文件夹-->
                        </ui-button>
                    </div>
                </ui-prop>
                <ui-prop name="热更配置(version.mainfest)">
                    <div class="flex-1 layout horizontal center">
                        <ui-input class="flex-1" disabled v-value="localGameVersionManifest"></ui-input>
                        <ui-button v-on:confirm="onOpenLocalGameManifestDir('release')">
                            <i class="icon-doc-text"></i>
                            <!--打开文件夹-->
                        </ui-button>
                    </div>
                </ui-prop>
                <ui-prop name="package url:">
                    <div class="flex-1 layout horizontal center">
                        <h4 class="flex-2">
                            {{localGamePackageUrl}}
                        </h4>
                        <a v-show="localGamePackageUrl&&localGamePackageUrl.length>0" href="{{localGamePackageUrl}}/version.manifest">
                            验证version.mainfest
                        </a>
                    </div>
                </ui-prop>
                <ui-prop name="游戏版本号:">
                    <div class="flex-1 layout horizontal center">
                        <h4 class="flex-2">{{localGameVersion}}</h4>
                        <ui-button title="将生成的2个manifest文件导入到项目中" class="end-justified blue" v-on:confirm="onImportManifestToGame('release')">
                            导入manifest
                        </ui-button>
                        <ui-button class="end-justified" v-on:confirm="initLocalGameVersion">
                            <i class="icon-arrows-cw"></i>
                            <!--刷新-->
                        </ui-button>
                    </div>
                </ui-prop>
            </div>
        </ui-section>

        <ui-section>
            <div class="header greenColor" style="color: #2fc9c1;">当前游戏配置:测试服</div>
            <ui-prop name="热更配置(检测提示)" v-show="localGameProjectManifestDebug.length===0||localGameProjectManifestDebug===null">
                <div class="flex-1 layout horizontal center">
                    <span class="flex-2" style="color: #ff1500;">
                        未发现测试服manifest热更新配置文件,请生成一份后导入到项目
                    </span>
                    <!--<ui-input class="flex-2" placeholder="未发现manifest热更新配置文件,请生成一份后导入到项目">-->

                    <!--</ui-input>-->
                    <ui-button title="将生成的2个manifest文件导入到项目中" class="end-justified red" v-on:confirm="onSelectProjectManifestDir('debug')">
                        导入
                    </ui-button>
                </div>
            </ui-prop>

            <div class="layout vertical" v-show="localGameProjectManifestDebug.length>0">
                <ui-prop name="热更配置(project.mainfest)">
                    <div class="flex-1 layout horizontal center">
                        <ui-input class="flex-1" disabled v-value="localGameProjectManifestDebug"></ui-input>
                        <ui-button v-on:confirm="onOpenLocalGameManifestDir('debug')">
                            <i class="icon-doc-text"></i>
                            <!--打开文件夹-->
                        </ui-button>
                    </div>
                </ui-prop>
                <ui-prop name="热更配置(version.mainfest)">
                    <div class="flex-1 layout horizontal center">
                        <ui-input class="flex-1" disabled v-value="localGameVersionManifestDebug"></ui-input>
                        <ui-button v-on:confirm="onOpenLocalGameManifestDir('debug')">
                            <i class="icon-doc-text"></i>
                            <!--打开文件夹-->
                        </ui-button>
                    </div>
                </ui-prop>
                <ui-prop name="package url:">
                    <div class="flex-1 layout horizontal center">
                        <h4 class="flex-2">
                            {{localGamePackageUrlDebug}}
                        </h4>
                        <a v-show="localGamePackageUrlDebug&&localGamePackageUrlDebug.length>0" href="{{localGamePackageUrlDebug}}/version.manifest">
                            验证version.mainfest
                        </a>
                    </div>
                </ui-prop>
                <ui-prop name="游戏版本号:">
                    <div class="flex-1 layout horizontal center">
                        <h4 class="flex-2">{{localGameVersionDebug}}</h4>
                        <ui-button title="将生成的2个manifest文件导入到项目中" class="end-justified blue" v-on:confirm="onImportManifestToGame('debug')">
                            导入manifest
                        </ui-button>
                        <ui-button class="end-justified" v-on:confirm="initLocalGameVersionDebug">
                            <i class="icon-arrows-cw"></i>
                            <!--刷新-->
                        </ui-button>
                    </div>
                </ui-prop>
            </div>
        </ui-section>

        <ui-section>
            <div class="header greenColor" style="color: #2fc9c1;">本地测试环境</div>
            <div class="layout vertical">
                <div class="layout horizontal center" style="display: none;">
                    <div style="display: none">
                        <ui-select class="" v-on:change="onTestEnvChange" v-value="testEnvSelect" id="testEnvSelect">
                            <option value='0'>本地</option>
                            <option value='1'>阿里云</option>
                            <option value='2'>发送邮件</option>
                        </ui-select>
                    </div>
                </div>
                <!-------------------------------本地测试环境-------------------------------------->
                <div class="layout vertical" v-if="testEnvLocal">
                    <ui-prop name="本地server路径">
                        <div class="flex-1 layout horizontal center">
                            <ui-input class="flex-2" disabled v-value="localServerPath"></ui-input>
                            <ui-button v-on:confirm="onSelectLocalServerPath">选择</ui-button>
                            <ui-button v-on:confirm="onOpenLocalServer">
                                <i class="icon-doc-text"></i>
                                <!--打开目录-->
                            </ui-button>
                        </div>
                    </ui-prop>

                    <ui-prop name="package url">
                        <div class="flex-1 layout horizontal center">
                            <h4 class="flex-2">{{serverPackageUrl}}</h4>
                            <a v-show="serverPackageUrl&&serverPackageUrl.length>0" href="{{serverPackageUrl}}/version.manifest">
                                验证version.manifest
                            </a>
                        </div>
                    </ui-prop>

                    <ui-prop name="服务器版本">
                        <div class="flex-1 layout horizontal center">
                            <h4 class="flex-2">{{serverVersion}}</h4>
                            <ui-button class="end-justified" v-on:confirm="refreshLocalServerVersion">
                                <i class="icon-arrows-cw"></i>
                                <!--刷新-->
                            </ui-button>
                        </div>
                    </ui-prop>

                    <ui-prop name="操作">
                        <div class="flex-1 layout horizontal center">
                            <h3 class="flex-2"></h3>
                            <ui-button class="end-justified red" v-on:confirm="onCleanSimRemoteRes">
                                <i class="icon-trash-empty" title="删除win32模拟器热更新资源"></i>清理模拟器缓存</ui-button>
                            <ui-button class="end-justified green" v-on:confirm="onCopyFileToLocalServer">部署测试服配置到本地</ui-button>
                        </div>
                    </ui-prop>
                    <ui-progress style="width: 100%;" v-value="copyProgress">50</ui-progress>
                </div>

                <!---------------------------------阿里云测试环境---------------------------------->
                <div class="layout vertical" v-if="testEnvALi">
                    <h2>阿里云</h2>
                    <ui-prop name="">

                    </ui-prop>
                    <div class="self-end">
                        <ui-button class="self-end green" v-on:confirm="onBtnClickAliTest"> 测试阿里云</ui-button>
                    </div>
                </div>
                <!---------------------------------邮件环境--------------------------------------->
                <div class="layout vertical" v-if="testEnvEmail">
                    <ui-prop name="添加邮件接收者">
                        <ui-input class="flex-2" v-on:blur="onInputMailPeopleOver" v-value="addMailPeople"></ui-input>
                        <ui-button v-if="isPeopleExist()">添加</ui-button>
                    </ui-prop>
                    <ui-prop name="邮件接收者" auto-height>
                        <div class="layout vertical">
                            <ui-checkbox v-for="(index, people) in emailPeopleArray" v-bind:value="people">
                                {{'['+index+']'+people}}
                            </ui-checkbox>
                        </div>
                    </ui-prop>

                    <ui-prop name="发布的游戏版本">
                        <ui-input class="flex-1" disabled v-value="serverRootDir"></ui-input>
                        <ui-input style="width: 100px;" disabled v-if="remoteServerVersion!== null && remoteServerVersion !== '' "
                            v-value="remoteServerVersion">1.0
                        </ui-input>
                    </ui-prop>
                    <ui-prop name="更新内容" auto-height>
                        <ui-text-area class="flex-1" resize-v placeholder="更新内容" v-value="emailContent">
                        </ui-text-area>
                    </ui-prop>
                    <div class="self-end">
                        <ui-button class="self-end green" v-on:confirm="onBtnClickSendMail"> 发送邮件</ui-button>
                    </div>
                </div>
            </div>

        </ui-section>

        <ui-section>
            <div class="header greenColor">日志</div>
            <div class="layout horizontal center self-end ">
                <div class="self-end">
                    <ui-button v-on:confirm="onCleanLog">清理</ui-button>
                </div>
            </div>
            <div>
                <textarea class="flex-1 " id="logTextArea" v-model="logView" style="width: 100%; height: 120px; background: #252525;	resize: none; color: #fd942b;	border-color: #fd942b;"></textarea>
            </div>
        </ui-section>

        <!-- <ui-section folded>

        </ui-section> -->
        <ui-section>
            <div class="header greenColor">帮助</div>
            <div class="layout horizontal center self-end ">
                <div class="self-end">
                    <ui-button v-on:confirm="onBtnClickHelpDoc">
                        GitHub文档
                    </ui-button>
                    <ui-button v-on:confirm="onBtnClickTellMe" style="background: url('http://wpa.qq.com/pa?p=2:825808091:51');width: 77px;height: 25px;"></ui-button>
                </div>
            </div>
        </ui-section>

    </div>

</div>